package pl.ydp.components.mathcell.mathrecognizer.engine.database.modelsets.math_basic.characters
{
	import pl.ydp.components.mathcell.mathrecognizer.characters.Character;
	import pl.ydp.components.mathcell.mathrecognizer.geometry.classification.PrimitiveType;
	import pl.ydp.components.mathcell.mathrecognizer.model.PrimitivesRelation;
	import pl.ydp.components.mathcell.mathrecognizer.model.RelationDescription;
	import pl.ydp.components.mathcell.mathrecognizer.model.RelationDescriptorType;
	import pl.ydp.components.mathcell.mathrecognizer.model.ShapeModel;
	import pl.ydp.components.mathcell.mathrecognizer.model.descriptors.ConnectionsDescriptor;
	import pl.ydp.components.mathcell.mathrecognizer.model.descriptors.CrossDescriptior;
	import pl.ydp.components.mathcell.mathrecognizer.model.descriptors.LocationDescriptor;
	import pl.ydp.components.mathcell.mathrecognizer.model.descriptors.SizeDescriptor;
	import pl.ydp.components.mathcell.mathrecognizer.model.presets.PrimitivePresets;
	
	public class MB_ch_apx
	{
		
		public static const MODELS_COUNT:Number = 1;
		
		//---------------------------------------------------
		
		public static function getModels():Array{
			
			var equalsShapeModels:Array = new Array();
			
			equalsShapeModels.push(getModel0());
			//equalsShapeModels.push(getModel1());	
			//equalsShapeModels.push(getModel2());		
			
			return equalsShapeModels;
		}
		
		//---------------------------------------------------
		
		private static function getModel0():ShapeModel{
			var approximation:ShapeModel;
			var name:String = "MB_≈_STD";
			var approximation_prim:Array = new Array();
			var approximation_ref:Array = new Array();
			var approximation_rel:Array = new Array();
			
			approximation_prim.push(PrimitiveType.WAVE, PrimitiveType.WAVE);
			
			approximation_ref.push(0,1,PrimitivePresets.RLT_FULL, 
							PrimitivePresets.RLT_LOWER_HALF, PrimitivePresets.RLT_UPPER_HALF);
			
			
			approximation_rel.push(new RelationDescription(0,1,new PrimitivesRelation(RelationDescriptorType.CROSS, CrossDescriptior.NOT_CROSSING, 10)));
			
			approximation_rel.push(new RelationDescription(0,1,new PrimitivesRelation(RelationDescriptorType.CONNECTION, ConnectionsDescriptor.NONE, 10)));
			
			approximation_rel.push(new RelationDescription(0,2,new PrimitivesRelation(RelationDescriptorType.SIZE, SizeDescriptor.WIDTH | SizeDescriptor.LONGER | SizeDescriptor.HALF, 5)));
			
			approximation_rel.push(new RelationDescription(0,3,new PrimitivesRelation(RelationDescriptorType.LOCATION, LocationDescriptor.INSIDE_WHOLE, 10)));
			
			
			approximation_rel.push(new RelationDescription(1,2,new PrimitivesRelation(RelationDescriptorType.SIZE, SizeDescriptor.WIDTH | SizeDescriptor.LONGER | SizeDescriptor.HALF, 5)));
			
			approximation_rel.push(new RelationDescription(1,4,new PrimitivesRelation(RelationDescriptorType.LOCATION, LocationDescriptor.INSIDE_WHOLE, 10)));
			
			
			
			approximation = new ShapeModel(Character.APPROXIMATION, approximation_prim, approximation_ref, approximation_rel, new Array(), name, false, true);
			
			return approximation;						
		}


	}
}